// ==UserScript==
// @name ccb365
// @author wgu
// @description  ccb365
// @include http://su.ccb365.com/*
// @include http://suzhou.ccbkey.*
// @include https://ibsbjstar.ccb.com.cn/app/B2CMainB1L1?CCB_IBSVersion=V5*
// ==/UserScript==

//console.log(location.href);
(function($,jQuery){
	if(location.href=="http://suzhou.ccbkey.com/"){
		var req=gw.req();
		req.open('GET','http://suzhou.ccbkey.com/Game/TiggerGame.aspx?type=StartErnie&random='+Math.random() * 10000,false);
		req.send();
		$('#ContentPlaceHolder1_Img1').click()
	}else if(location.href.indexOf('http://suzhou.ccbkey.com/payment/pay.aspx?c=')!=-1){
		window.aspnetForm=$('#aspnetForm')[0];
		window.$(function() {
			setTimeout('$("#btn_pay").click()',100);
		});
	}else if(location.href.indexOf('http://su.ccb365.com/payment/pay.aspx?c=')!=-1){
		window.aspnetForm=$('#aspnetForm')[0];
		$(".btn").click()
	}else if(location.href.indexOf('https://ibsbjstar.ccb.com.cn/app/')!=-1){
		if($('.PayForContainer_Body_Right_tab_1_on').length==1){
			type_onclick(1);
		}else if($('#SUBMOBILE').length==1){
			window.alert=function(str){
				console.log(str);
			}
			window.confirm=function(str){
				console.log(str);
				return true;
			}
			$('#SUBMOBILE').val('6859');
			fsend();
			//console.log($('#SMSCODE'));
			//console.log('end');
			function __kk(){
				if($('#SMSCODE_TR')[0].style.display=='none'){
					setTimeout(__kk,400);
				}else{
					$('#SMSCODE').focus();
				}
			}
			__kk();
		}else{
			//console.log(formatAcc.toString());
			$('#a65')[0].value='6227 0020 0153 3106 828';
			formatAcc($('#a65')[0]);
			$('#PT_CONFIRM_PWD').focus();
		}
	}else if(location.href.indexOf('http://suzhou.ccbkey.com/payment/PayReturn.aspx')!=-1){
		$('#ContentPlaceHolder1_imgbtn_pay').click();
	}

})(___jQuery,___jQuery)

/*

var req=gw.req();
		req.open('GET','http://su.ccb365.com/FlashAward/AwardXML.aspx?date='+new Date().valueOf(),false);
		req.send();
		window.location.href="http://su.ccb365.com/FlashAward/AwardDef.aspx";



https://ibsbjstar.ccb.com.cn/app/ccbMain?__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTY0NDEyMDIyM2RkC4G5moM%2BpOYTqOK%2Bxxng4DJn9IU%3D&__EVENTVALIDATION=%2FwEWAgLtgKqyAgKr44LeDvY0CRRMv3qNWpp27Sor51zlOo%2F%2F&MERCHANTID=105320548160016&POSID=331504943&BRANCHID=322000000&ORDERID=C1203261308187222753331&PAYMENT=2&CURCODE=01&REMARK1=45428&REMARK2=528843&TXCODE=520100&MAC=0d7b4d83a54edcdb6aacc7dd2f0c763d&TYPE=1&PUB=8f566450d8c0ae08bbe2348f020111&GATEWAY=&CLIENTIP=58.210.76.18&REGINFO=&PROINFO=&REFERER=su.ccb365.com
ccbMain?__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTY0NDEyMDIyM2RkC4G5moM%2BpOYTqOK%2Bxxng4DJn9IU%3D&__EVENTVALIDATION=%2FwEWAgLtgKqyAgKr44LeDvY0CRRMv3qNWpp27Sor51zlOo%2F%2F&MERCHANTID=105320548160016&POSID=331504943&BRANCHID=322000000&ORDERID=C1203261308187222753331&PAYMENT=2&CURCODE=01&REMARK1=45428&REMARK2=528843&TXCODE=520100&MAC=0d7b4d83a54edcdb6aacc7dd2f0c763d&TYPE=1&PUB=8f566450d8c0ae08bbe2348f020111&GATEWAY=&CLIENTIP=58.210.76.18&REGINFO=&PROINFO=&REFERER=su.ccb365.com


/app/B2CMainB1L1?CCB_IBSVersion=V5&SERVLET_NAME=B2CMainB1L1&BRANCHID=322000000&SKEY=&MERCHANTID=105320548160016&POSID=331504943&ORDERID=C1203261308187222753331&PAYMENT=2&CURCODE=01&REMARK1=45428&REMARK2=528843&TYPE=1&GATEWAY=&CLIENTIP=58.210.76.18&REGINFO=&PROINFO=&REFERER=su.ccb365.com&INSTALLNUM=&MAC=0d7b4d83a54edcdb6aacc7dd2f0c763d&TXCODE=410304&FIRST=Y
/app/B2CMainB1L1?CCB_IBSVersion=V5&SERVLET_NAME=B2CMainB1L1&BRANCHID=322000000&SKEY=&MERCHANTID=105320548160016&POSID=331504943&ORDERID=C1203261308187222753331&PAYMENT=2&CURCODE=01&REMARK1=45428&REMARK2=528843&TYPE=1&GATEWAY=&CLIENTIP=58.210.76.18&REGINFO=&PROINFO=&REFERER=su.ccb365.com&INSTALLNUM=&MAC=0d7b4d83a54edcdb6aacc7dd2f0c763d&TXCODE=410304&FIRST=Y
if($('#LOGPASS').length==1){
	type_onclick(1)
}else{
	$('.PayForContainer_Body_Right_L_Center input').val('6227 0020 0153 3106 828');
	$('#PT_CONFIRM_PWD').fouse();
}

/app/B2CMainB1L1?CCB_IBSVersion=V5&SERVLET_NAME=B2CMainB1L1&BRANCHID=322000000&SKEY=&MERCHANTID=105320548160016&POSID=331504943&ORDERID=C1203261316531902753331&PAYMENT=2&CURCODE=01&REMARK1=45437&REMARK2=528897&TYPE=1&GATEWAY=&CLIENTIP=58.210.76.18&REGINFO=&PROINFO=&REFERER=su.ccb365.com&INSTALLNUM=&MAC=3630b897c4c61b618c5fdd82b4a59bdc&TXCODE=410304&FIRST=Y
/app/B2CMainB1L1?CCB_IBSVersion=V5&SERVLET_NAME=B2CMainB1L1&BRANCHID=322000000&SKEY=&MERCHANTID=105320548160016&POSID=331504943&ORDERID=C1203261316531902753331&PAYMENT=2&CURCODE=01&REMARK1=45437&REMARK2=528897&TYPE=1&GATEWAY=&CLIENTIP=58.210.76.18&REGINFO=&PROINFO=&REFERER=su.ccb365.com&INSTALLNUM=&MAC=3630b897c4c61b618c5fdd82b4a59bdc&TXCODE=410304&FIRST=Y
window.alert=function(str){
	console.log(str);
}
$('#SUBMOBILE').val('6859');
fsend();


window.confirm=function(str){
	console.log(str);
	return true;
}*/